part of 'WebRtcData.dart';

WebRtcInvitationReq _$WebRtcInvitationReqFromJson( Map<String, dynamic> json) =>
    WebRtcInvitationReq(
      roomName: json['roomName'] as String,
      chatType: $enumDecode(_$ChatTypeEnumMap, json['chatType']),
      userIds: (json['userIds'] as List<dynamic>).map((e) => e as String).toSet(),
    )
      ..fromUserId = json['fromUserId'] as String?
      ..createDateTime = json['createDateTime'] == null ? null : DateTime.parse(json['createDateTime'] as String)
      ..localSeq = json['localSeq'] as String?
;

Map<String, dynamic> _$WebRtcInvitationReqToJson(WebRtcInvitationReq instance)=>
    <String, dynamic>{
      'createDateTime': DateUtil.formatDate(instance.createDateTime),
      'localSeq': instance.localSeq,
      'roomName': instance.roomName,
      'chatType': _$ChatTypeEnumMap[instance.chatType],
      'fromUserId': instance.fromUserId,
      'userIds': instance.userIds.toList(),
    };

WebRtcInvitationResultReq _$WebRtcInvitationResultReqFromJson(Map<String, dynamic> json) =>
    WebRtcInvitationResultReq(
      toUserId: json['toUserId'] as String,
      isAccept: json['isAccept'] as bool,
    )
      ..reason = json['reason'] as String?
      ..createDateTime = json['createDateTime'] == null ? null : DateTime.parse(json['createDateTime'] as String)
      ..localSeq = json['localSeq'] as String?
;

Map<String, dynamic> _$WebRtcInvitationResultReqToJson(WebRtcInvitationResultReq instance)=>
    <String, dynamic>{
      'createDateTime': DateUtil.formatDate(instance.createDateTime),
      'localSeq': instance.localSeq,
      'toUserId': instance.toUserId,
      'isAccept': instance.isAccept,
      'reason': instance.reason,
    };


Map<String, dynamic> _$InvitationResultListToJson(InvitationResultList instance)=>
    <String, dynamic>{
      'invitationResultList': instance.invitationResultList.map((e) => e.toJson()).toList(),
    };

InvitationResultList _$InvitationResultListFromJson(Map<String, dynamic> json) =>
    InvitationResultList(
      invitationResultList: (json['invitationResultList'] as List<dynamic>)
          .map((e) => InvitationResult.fromJson(e as Map<String, dynamic>))
          .toList(),
    );

WebRtcCancelReq _$WebRtcCancelReqFromJson( Map<String, dynamic> json) =>
    WebRtcCancelReq(
      userIds: (json['userIds'] as List<dynamic>).map((e) => e as String).toSet(),
    )
      ..createDateTime = json['createDateTime'] == null ? null : DateTime.parse(json['createDateTime'] as String)
      ..localSeq = json['localSeq'] as String?
;

Map<String, dynamic> _$WebRtcCancelReqToJson(WebRtcCancelReq instance)=>
    <String, dynamic>{
      'createDateTime': DateUtil.formatDate(instance.createDateTime),
      'localSeq': instance.localSeq,
      'userIds': instance.userIds.toList(),
    };


Map<String, dynamic> _$InvitationResultToJson(InvitationResult instance)=>
    <String, dynamic>{
      'userId': instance.userId,
      'isOffline': instance.isOffline,
      'isReject': instance.isReject,
    };

InvitationResult _$InvitationResultFromJson(Map<String, dynamic> json) =>
    InvitationResult(
      userId: json['userId'] as String,
      isOffline: json['isOffline'] as bool,
      isReject: json['isReject'] as bool,
    )
;

const _$ChatTypeEnumMap = {
  ChatType.audio: 1,
  ChatType.video: 2,
  ChatType.sharing: 3,
};
